package com.itheima.mapper.system;

import com.github.pagehelper.Page;
import com.itheima.domain.system.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 部门操作 持久层接口
 */
public interface DeptMapper {

    Page<Dept> findAll();

    @Insert("insert into ss_dept values(#{id},#{deptName},#{parentId},#{state})")
    void addDept(Dept dept);

    void deleteByIds(String[] idArr);

    Dept findById(String id);

    @Update("update ss_dept set dept_name=#{deptName},parent_id=#{parentId},state=#{state} where dept_id=#{id}")
    void updateDept(Dept dept);
}
